// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
module.exports = {
    publicPath: "",
    lintOnSave: true,
    productionSourceMap: false,
    // configureWebpack: config => {
    //     if (process.env.NODE_ENV === 'production') {
    //         return {
    //             plugins: [
    //                 new BundleAnalyzerPlugin()
    //             ]
    //         }
    //     }
    // },
    chainWebpack: (config) => {
        //忽略的打包文件
        config.externals({
            'vue': 'Vue',
            'vue-router': 'VueRouter',
            'vuex': 'Vuex',
            'axios': 'axios',
            'element-ui': 'ELEMENT',
        })
        const entry = config.entry('app')
        entry
            .add('babel-polyfill')
            .end()
        entry
            .add('classlist-polyfill')
            .end()
        entry
            .end()
    },
    css: {
        extract: {ignoreOrder: true}
    },
    devServer: {
        port: process.env.VUE_APP_PORT,
        proxy: {
            [process.env.VUE_APP_BASE_URL]: {
                target: 'http://127.0.0.1:10010',
                // target: 'http://192.168.1.5:8001',
                ws: true,
                pathRewrite: {
                    ['^' + process.env.VUE_APP_BASE_URL]: '/'
                }
            },
            '/system': {
                target: 'http://127.0.0.1:10010',
                // target: 'http://192.168.1.5:8001',
                ws: true,
                pathRewrite: {
                    ['^/system']: '/system'
                }
            }
        }
    }
}
